package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CarMerchantMapper;
import com.ruoyi.system.domain.CarMerchant;
import com.ruoyi.system.service.ICarMerchantService;

/**
 * 商户Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-06
 */
@Service
public class CarMerchantServiceImpl implements ICarMerchantService 
{
    @Autowired
    private CarMerchantMapper carMerchantMapper;

    /**
     * 查询商户
     * 
     * @param id 商户主键
     * @return 商户
     */
    @Override
    public CarMerchant selectCarMerchantById(Long id)
    {
        return carMerchantMapper.selectCarMerchantById(id);
    }

    /**
     * 查询商户列表
     * 
     * @param carMerchant 商户
     * @return 商户
     */
    @Override
    public List<CarMerchant> selectCarMerchantList(CarMerchant carMerchant)
    {
        return carMerchantMapper.selectCarMerchantList(carMerchant);
    }
    /**
     * 查询商户列表评分排序
     *
     * @param carMerchant 商户
     * @return 商户
     */
    @Override
    public List<CarMerchant> selectCarMerchantListbyrate(CarMerchant carMerchant)
    {
        return carMerchantMapper.selectCarMerchantListbyrate(carMerchant);
    }

    /**
     * 新增商户
     * 
     * @param carMerchant 商户
     * @return 结果
     */
    @Override
    public int insertCarMerchant(CarMerchant carMerchant)
    {
        return carMerchantMapper.insertCarMerchant(carMerchant);
    }

    /**
     * 修改商户
     * 
     * @param carMerchant 商户
     * @return 结果
     */
    @Override
    public int updateCarMerchant(CarMerchant carMerchant)
    {
        return carMerchantMapper.updateCarMerchant(carMerchant);
    }

    /**
     * 批量删除商户
     * 
     * @param ids 需要删除的商户主键
     * @return 结果
     */
    @Override
    public int deleteCarMerchantByIds(Long[] ids)
    {
        return carMerchantMapper.deleteCarMerchantByIds(ids);
    }

    /**
     * 删除商户信息
     * 
     * @param id 商户主键
     * @return 结果
     */
    @Override
    public int deleteCarMerchantById(Long id)
    {
        return carMerchantMapper.deleteCarMerchantById(id);
    }
    /*
    根据商户名称查找商户
     */
    @Override
    public List<CarMerchant> listMerchantByName(String name) {
        return carMerchantMapper.listMerchantByName(name);
    }
}
